import { createRouter, createWebHashHistory } from 'vue-router'

// 页面组件导入（后续会创建这些文件）
import Home from './views/Home.vue'
import TaskDetail from './views/TaskDetail.vue'
import TaskPublish from './views/TaskPublish.vue'
import MyTasks from './views/MyTasks.vue'
import Chat from './views/Chat.vue'
import Manage from './views/Manage.vue'

const routes = [
  { path: '/', component: Home },
  { path: '/task/:id', component: TaskDetail, props: true },
  { path: '/publish', component: TaskPublish },
  { path: '/my-tasks', component: MyTasks },
  { path: '/chat/:userId', component: Chat },
  { path: '/manage', component: Manage, props: route => ({ id: route.query.id }) }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router 